<template>
  <div>
   <button @click="componentId = 'MyLeft'">left</button>
   <button @click="componentId ='MyRight'">right</button>
     <keep-alive include="MyRight,MyLeft">
      <component :is="componentId"></component>
     </keep-alive>
  </div>
</template>

<script>
import MyLeft from './components/MyLeft.vue'
import MyRight from './components/MyRight.vue'
export default {
  components: { MyLeft, MyRight },
  data () {
    return {
    componentId:'MyLeft'
    }
  },

 
}

</script>

<style>

</style>